<template>
	<view class="container">
	

		<view class="mt5" >
		
			<view class="mt15 mlr15 bgWhite radius10 boxshadow20 pb15">
				<view class="moduletitle  align-center justify-start plr15">
					<text></text>
					<view class="ft16 ml10">
						课程信息
					</view>
				</view>
				<view class="maininfo ptb15 plr15">
					<view class="align-center justify-between mb10" style="border: 1px solid #E0E0E0;border-radius: 15rpx;padding: 6rpx;">
						<image src="/static/images/info.png" class="mr5" style="width: 80rpx;" mode="widthFix"></image>
						名称:
						<text class="flex1 justify-end" style="color:#0082DB ;">{{detail.title}}</text>
					</view>
					<view class="align-center justify-between mb10" style="border: 1px solid #E0E0E0;border-radius: 15rpx;padding: 6rpx;">
						<image src="/static/images/info.png" class="mr5" style="width: 80rpx;" mode="widthFix"></image>
						单价:
						<text class="flex1 justify-end" style="color:#999 ;"></text>
					</view>
					<view class="justify-end align-end" style="line-height: 1;">
						总价：<text style="color:#0082DB ;">￥</text> <text style="color:#0082DB;font-weight: 600;font-size: 50rpx;"></text>
					</view>
				</view>
			</view>
			
			<view class="mt15 mlr15 bgWhite radius10 boxshadow20 pb15">
				<view class="moduletitle  align-center justify-start plr15">
					<text></text>
					<view class="ft16 ml10">
						用户信息
					</view>
				</view>
				<view class="mb10 justify-between align-center plr15 pb15 pt15" style="border-bottom: 1px solid #E0E0E0;border-top: 1px solid #E0E0E0;">
					<image src="/static/images/user.png" class="mr5" mode="widthFix" style="width: 40rpx;"></image>证件号码:
					<text class="flex1 justify-end" style="color:#999 ;">{{userinfo.idcard}}</text>
				</view>
				<view class="justify-between align-center plr15">
					<image src="/static/images/xingming.png" class="mr5" mode="widthFix" style="width: 40rpx;"></image>学员姓名:
					<text class="flex1 justify-end" style="color:#999 ;">{{userinfo.username}}</text>
				</view>
			</view>
			<view class="mt15 mlr15 bgWhite radius10 boxshadow20 pb15">
				<view class="moduletitle  align-center justify-start plr15">
					<text></text>
					<view class="ft16 ml10">
						选择支付方式
					</view>
				</view>
				<view class=" justify-between align-center plr15 pb15 pt15" style="border-top: 1px solid #E0E0E0;">
					<image src="/static/images/wechat.png" class="mr5" mode="widthFix" style="width: 50rpx;"></image>微信支付:
					<view class="flex1 justify-end">
						<image src="/static/images/chosed.png" style="width: 50rpx;" mode="widthFix"></image>
					</view>
				</view>
			</view>	
		</view>

		
		<view class="" style="height: 200rpx;">
		</view>
		
		<view class="submit bgWhite boxshadow20 align-center justify-between">
			<view class="cancel align-center justify-center flex1">
				<image src="/static/images/cancel.png" mode="widthFix" style="width: 30rpx;"></image>取消订单
			</view>
			<view class="logbtn flex1" @click="learn">
				立即报名
			</view>
		</view>

	</view>
</template>

<script>
	let app = getApp();
	export default {
		components: {

		},
		data() {
			return {
				act: 0,
				id:"",
				detail:{},
				userinfo:{},
				isLogin:uni.getStorageSync('logintoken')
				
			}
		},
		onLoad(opt) {
			
			if(opt.id){
				this.id =opt.id
				this.getDetail()
			}

		},
		mounted() {



			// 使用函数生成一个正弦波形


		},

		methods: {
			learn(){
				this.$api.submitInfo({info_id:this.id}).then(res=>{
					console.log(res)
					if(res.code==1){
						this.$utils.msg('报名成功')
						setTimeout(()=>{
						uni.switchTab({
							url:'/pages/study/index'
						})	
						},1000)
					}else{
						this.$utils.msg(res.msg)
					}
				})
			},
			getDetail(){
				this.$api.getDetailInfo({id:this.id}).then(res=>{
					console.log(res)
					this.detail =res.data
				})
				this.$api.userIndex().then(res=>{
					console.log(res)
					this.userinfo=res.data
				})
			}
			
		}





	}
</script>
<style scoped lang="scss">
	page {
		color: #343434;
	}

	.header {
		width: 100%;
		height: 110rpx;
		background-color: #fff;

		box-sizing: border-box;
		color: #969696;
		position: fixed;
		top: 88rpx;
		left: 0;
		z-index: 999;
		display: flex;

		view {
			text-align: center;
			font-size: 28rpx;
			height: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.on {
			color: #000;
			position: relative;
		}

		.on::after {
			content: "";
			width: 20rpx;
			height: 4rpx;

			background: #0082DB;
			position: absolute;
			bottom: 0;
			left: 0;
			right: 0;
			margin: auto;

		}

		.middle {
			position: relative;
		}

		.middle::after {
			content: "";
			width: 2rpx;
			height: 30rpx;
			background: #E0E0E0;
			position: absolute;
			top: 0;
			bottom: 0;
			margin: auto;
			right: 0;
		}

		.middle::before {
			content: "";
			width: 2rpx;
			height: 30rpx;
			background: #E0E0E0;
			position: absolute;
			top: 0;
			bottom: 0;
			margin: auto;
			left: 0;
		}
	}



	.tag {
		background-color: rgb(255, 219, 109);
		color: #fff;
		font-size: 26rpx;
		padding: 4rpx 8rpx;
		border-radius: 10rpx;
		margin-right: 10rpx;
	}

	.coursedata {
		padding: 20rpx;
		color: #969696;
		font-size: 24rpx;

		image {
			width: 300rpx;
			height: 236rpx;
			border-radius: 15rpx;
			margin-right: 20rpx;
		}

		.title {
			font-size: 33rpx;
			color: #000;
			margin-bottom: 10rpx;
		}

		.price {
			font-weight: bold;
			color: #1FACFF;
			font-size: 42rpx;
		}
	}

	.menudata {
		margin: 20rpx;
		height: 72rpx;
		border: 1px solid #cad9fe;
		font-size: 28rpx;
		border-radius: 10rpx;
		padding: 0 20rpx;
	}

	.moduletitle {
		height: 116rpx;

		text {

			width: 6rpx;
			height: 18rpx;
			background: #0082DB;
			border-radius: .5rem;
			display: block;
		}
	}

	.maininfo {
		border-top: 2rpx solid #E0E0E0;


	}

	.submit {
		width: 100%;
		// padding: 20rpx;
		height: 100rpx;
		// border-radius: 20rpx;
		position: fixed;
		left: 0;
		right: 0;
		margin: auto;
		bottom: 0;
	}

	.logbtn {
		background: linear-gradient(180deg, #98D5FF 0%, #0082DB 100%);
		// border-radius: 20rpx;
		
		height: 100rpx;
		text-align: center;
		line-height: 100rpx;
		color: #fff;
	}
	.slottitle{
		font-size: 34rpx;
		color: #343434;
		image{
			width: 56rpx;
			height: 56rpx;
		}
	}
	.contentbox{
		border: 1px solid #E0E0E0;
		border-radius: 15rpx;
		padding:10rpx 20rpx;
		font-size: 24rpx;
	}
	.contentTitle{
		width: 147rpx;
		height: 84rpx;
		background-image: url('../../static/images/bg6.png');
		background-size: 100% 100%;
		margin-right: 20rpx;
		text-align: center;
		line-height: 84rpx;
		color: #0082DB;
	}
	
	// /deep/.uv-collapse-item__content{
	// 	height: auto!important;
	// }
</style>